//
//  ViewController.m
//  DragViewDemo
//
//  Created by 吳瀾洲 on 2020/8/18.
//  Copyright © 2020 kingboyrang. All rights reserved.
//

#import "ViewController.h"
#import "GridView.h"

@interface ViewController ()
@property(nonatomic,strong) GridView *grid;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    PageModel *page = [[PageModel alloc] init];
    page.name = @"页面1";
    page.row = 5;
    page.column = 4;
    
    NSMutableArray *buttons = [NSMutableArray arrayWithCapacity:0];
    [buttons addObject:[ButtonModel createModelWithName:@"开机"]];
    [buttons addObject:[ButtonModel createModelWithName:@"关机"]];
    [buttons addObject:[ButtonModel createModelWithName:@"重启"]];
    
    [buttons addObject:[ButtonModel createModelWithName:@"复制"]];
    [buttons addObject:[ButtonModel createModelWithName:@"粘贴"]];
    [buttons addObject:[ButtonModel createModelWithName:@"剪切"]];
    [buttons addObject:[ButtonModel createModelWithName:@"快照"]];
    [buttons addObject:[ButtonModel createModelWithName:@"选择"]];
    [buttons addObject:[ButtonModel createModelWithName:@"全选"]];
    [buttons addObject:[ButtonModel createModelWithName:@"睡眠"]];
    [buttons addObject:[ButtonModel createModelWithName:@"待机"]];
    [buttons addObject:[ButtonModel createModelWithName:@"关于"]];
    [buttons addObject:[ButtonModel createModelWithName:@"唤醒"]];
    page.buttonList = buttons;
   
    self.grid = [[GridView alloc] initWithFrame:self.view.frame];
    self.grid.pageModel = page;
    [self.grid createGrid];
    [self.view addSubview:self.grid];
}
- (void)viewWillLayoutSubviews{
    [super viewWillLayoutSubviews];
    self.grid.frame = self.view.frame;
}


@end
